<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>MyPetstore</title>
</head>
<body>
<div th:replace="common/admintop"></div>

<div id="Content">

    <div id="BackLink">
        <a href="/admin/viewAdminMain">Back</a>
    </div>

    <p align="center"><font color="green" th:text="${changeMsg}"></font></p>

    <div id="Catalog">

        <h3>Order Information</h3>

        <table class="rwd-table">
            <tr  class="trHead">
                <th><b>Username</b></th>
                <th><b>Order</b></th>
                <th><b>Status</b></th>
                <th><b></b></th>
            </tr>
            <tr th:each="order:${orderList}">
                <td th:text="${order.getUsername()}"> username</td>
                <td><a th:href="@{/admin/viewEditOrder(orderId=${order.orderId})}" th:text="${order.getOrderId()}">order</a></td>
                <td th:text="${order.getStatus()}">status</td>
                <td>
                    <a th:href="@{/admin/viewEditOrder(orderId=${order.orderId})}" class="btn">edit</a>
                    <a th:href="@{/admin/removeOrder(orderId=${order.orderId})}" class="btn">delete</a>
                    <span th:if="${order.getStatus() eq 'P'}">
                        <a th:href="@{/admin/dispatchStatus(orderId=${order.orderId})}" class="btn">deliver</a>
                    </span>
                    <span th:if="${order.getStatus() eq 'D'}">
                        <a th:href="@{/admin/finishStatus(orderId=${order.orderId})}" class="btn">&nbsp finish &nbsp</a>
                    </span>
                    <span th:if="${order.getStatus() eq 'F'}">
                        &nbsp Finished
                    </span>
                    <span th:if="${order.getStatus() eq 'U'}">
                        &nbsp Unpaid
                    </span>
                </td>
            </tr>
        </table>

    </div>
</div>

<div th:replace="common/bottom"></div>
</body>
</html>